home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / gfx / misc / dephcol.lha / dephcol / dephcol.e < prev    next >
Text File  |  1999-01-06  |  4KB  |  79 lines

  1. PROC main() HANDLE
  2. DEF d=0
  3.  
  4. d:=Val(arg) /* Let's get the alue from the shell args */
  5.  
  6. IF d<1 /* No point in going futher as 1 bit IS lowest bit possible :-D */
  7.    WriteF('Invalid value: Value to low!\n')
  8.    Raise(10)
  9. ENDIF
  10.    IF d>32 /* We can't go higher due to 32bit math, higher need 64bit math */
  11.    WriteF('Invalid value: Value to high!\n')
  12.    Raise(10)
  13. ENDIF
  14.  
  15. WriteF('Depth \d: ',d)
  16. IF d<31
  17.    WriteF('\d',Shl(1,d)) /* This is the magic, just shift the depth value, */
  18. ELSE                     /* 1 bit to the left and wher'e done :-) */
  19.    SELECT d              /* Not true really 31 and 32 make trouble, */
  20.      CASE 31             /* due to 32bit math/routines 31/32 value get signed */
  21.           WriteF('2147483648') /* So I have prepared two values for us here */
  22.      CASE 32                   /* don't you just love these cooking shows? :-D */
  23.           WriteF('4294967296') /* with 64bit rutines and <digit to string> print,*/
  24.    ENDSELECT                   /* there should be no problems like this */
  25. ENDIF                          /* well except 63 and 64 bit though :-) */
  26. WriteF(' Colors!')
  27. SELECT d /* now for the text */
  28.   CASE 1; WriteF(' ;Black and white is sooo cute! (it is)')
  29.   CASE 2; WriteF(' ;Default WB, wow lot''s of colors! (yeah right)')
  30.   CASE 3; WriteF(' ;Getting better, not THAT bad WB though.')
  31.   CASE 4; WriteF(' ;Cartoons? PS! Max color on Hires ECS')
  32.   CASE 5; WriteF(' ;Cartoons? PS! Max color on Lores ECS (EHB = 64)')
  33.   CASE 6; WriteF(' ;This is more like it. (HAM6 = 4096)')
  34.   CASE 7; WriteF(' ;Getting better!')
  35.   CASE 8; WriteF(' ;AGA here we come, wow a rainbow! (HAM8 = 262144)')
  36.   CASE 9; WriteF(' ;Never seen one of those yet!')
  37.   CASE 10; WriteF(' ;Hmm, unusual.')
  38.   CASE 11; WriteF(' ;Very rare.')
  39.   CASE 12; WriteF(' ;Ah, popular among cheaper digtizers.')
  40.   CASE 13; WriteF(' ;Hmm, what?!!')
  41.   CASE 14; WriteF(' ;Yeah I know lots of weird colors!')
  42.   CASE 15; WriteF(' ;Not really that much used you know!')
  43.   CASE 16; WriteF(' ;NOW! Where really starting to talk colors!')
  44.   CASE 17; WriteF(' ;Might have seen these once in a while!')
  45.   CASE 18; WriteF(' ;Moving on up!')
  46.   CASE 19; WriteF(' ;Upwards I say, upwards!')
  47.   CASE 20; WriteF(' ;Getting high in here!')
  48.   CASE 21; WriteF(' ;Woa this is really getting high!')
  49.   CASE 22; WriteF(' ;Don''t look down but...')
  50.   CASE 23; WriteF(' ;Eeek I think I''m gonna fall!!!')
  51.   CASE 24; WriteF(' ;Amazing isn''t it? Shangri La (or GFX cards :-)')
  52.   CASE 25; WriteF(' ;Don''t ask me!')
  53.   CASE 26; WriteF(' ;Hey stop asking me!')
  54.   CASE 27; WriteF(' ;Who knows!')
  55.   CASE 28; WriteF(' ;I don''t care!')
  56.   CASE 29; WriteF(' ;I''m getting sick!')
  57.   CASE 30; WriteF(' ;Cool, this isn''t so bad!')
  58.   CASE 31; WriteF(' ;Aw shit, I think I just hit the moon up here!')
  59.   CASE 32; WriteF(' ;WOA! WHAT A TRIP! Almost like... real, man!')
  60. ENDSELECT
  61. WriteF('\n')
  62. EXCEPT
  63. ENDPROC exception
  64.  
  65. /* YES! I KNOW I could have put the color values with the text,
  66.    but where's the fun in doing that?
  67.    (other than playing with the calculator)
  68.    Nah I like my rutine it's simple,
  69.    and it works (except for 31/32 depth due to limitations in 32math)
  70.    And I discovered/thought of it after playing with depth calculation.
  71.    If anyone wish to make a better one that goes to 64bits in depth,
  72.    or gosh perhaps convert back from colors to depth then feel free
  73.    to do so this program is Freely Distributable Public domain.
  74.  
  75.    Roger Hågensen <emsai@online.no>
  76. */
  77.  
  78. CHAR '$VER: dephcol 1.0 (6.1.1999) #PROGRAM © Msi Software',0
  79.